#!/bin/bash
help()
{
        echo "command : deployTemplate -i instance_id"
        echo "ex.  deployTemplate -i 367a50b8-ae03-48c6-8f44-f2e4d7be7dfd"
}

while [ -n "$1" ]
    do
    case "$1" in
        -i)
            instance_id=$2
            shift
            ;;

         *)
        echo "command errors.."
                        help
                        exit
            ;;
    esac
   shift
 done

if [ "$instance_id" = "" ];then
        help
        exit
fi

nohup /usr/bin/python createTemplate.py -i $instance_id  > /tmp/nohup.test 2>&1 &
echo "command run successful"
